import http from '@/utils/http';
// 获取页面数据
export const GetMeetingManage = async (myData: any) => {
  return http({
    url: '/back/meeting/list',
    method: 'post',
    data: {
      limit: myData.limit,
      meetingName: myData.meetingName,
      page: myData.page,
      status: myData.status,
    },
  });
};

// 会议详情
export const getMeetingInfo = async (id: any) => {
  return http({
    url: `/back/meeting/find/${id}`,
    method: 'get',
  });
};

// 会议报名人员信息
export const getEnrollInfo = async (id: any) => {
  return http({
    url: `/back/meetingApplication/list/${id}`,
    method: 'get',
  });
};

// 添加数据
export const addMeetingInfo = async (obj: any) => {
  return http({
    url: '/back/meeting/add',
    method: 'post',
    data: {
      maximumPeopleNumber: obj.maximumPeopleNumber,
      meetingAgenda: obj.meetingAgenda,
      meetingDeadline: obj.meetingDeadline,
      meetingEndTime: obj.meetingEndTime,
      meetingHotel: obj.meetingHotel,
      meetingId: 0,
      meetingMode: obj.meetingMode,
      meetingName: obj.meetingName,
      meetingPlace: obj.meetingPlace,
      meetingResourceDtoList: [
        {
          resourceName: obj.meetingResourceDtoList[0].resourceName,
          resourceType: obj.meetingResourceDtoList[0].resourceType,
          resourceUrl: obj.meetingResourceDtoList[0].resourceUrl,
        },
      ],
      meetingStartTime: obj.meetingStartTime,
      speaker: obj.speaker,
      teacherId: 0,
      trainingArea: obj.trainingArea,
    },
  });
};

// 删除数据
export const delMeetingList = async (id: any) => {
  return http({
    url: `/back/meeting/delete/${id}`,
    method: 'DELETE',
  });
};

// 上传图片
export const uploadImg = async (raw: any) => {
  return http.post('/back/oss/image/image', raw, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};

// 上传文档
// export const uploadDoc = async (raw: any) => {
//   return http.post('/oss/image/doc', raw, {
//     headers: {
//       'Content-Type': 'multipart/form-data',
//     },
//   });
// };

// 学生会议数据
export const getStdMeetingInfo = (id: any) => {
  return http({
    url: `/fore/meeting/findMeeting/${id}`,
    method: 'get',
  });
};
